import axios from '@/lib/apirequest'

export const fileUpload = (data) => {
  return axios.request({
    url: 'api_fileup/uploadfile',
    data,
    method: 'post',
    headers:{
      'Content-Type': 'multipart/form-data'
    }
  })
}

export const ajax = ({token,api,type,mctoken,cityId}) => {
  var data = {token,api,type,mctoken,cityId};
  if (mctoken) {
    return axios.request({
      url: 'api_request/ajax',
      data,
      method: 'post',
      headers:{
        'token': mctoken
      }
    })
  }else{
    return axios.request({
      url: 'api_request/ajax',
      data,
      method: 'post',
    })
  }
}